package com.example.myproject.view;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Paint;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;

import com.example.myproject.R;

/**
 * Created by Administrator on 2018/3/23 0023.
 *
 * 隔壁 TableView 的嵌套view
 *
 */
public class TableChildView extends View {

    private int imag1;
    private int imag2;
    private String mag;

    public TableChildView(Context context) {
        this(context, null, 0);
    }
    public TableChildView(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs, 0);
    }
    public TableChildView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);

        TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.TableChildView);
        if(array != null){
            imag1 = array.getInteger(R.styleable.TableChildView_imagSource1, 0);
            imag2 = array.getInteger(R.styleable.TableChildView_imagSource2, 0);
            mag = array.getString(R.styleable.TableChildView_txtSource);
            array.recycle();
        }

        Paint p=new Paint();
        p.setAntiAlias(true);
        p.setColor(getResources().getColor(R.color.black01));
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);

    }
}
